/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package digital_ink;

import com.sun.rave.faces.data.DefaultSelectItemsArray;
import com.sun.rave.faces.data.DefaultTableDataModel;
import com.sun.rave.web.ui.appbase.AbstractFragmentBean;
import com.sun.webui.jsf.component.Hyperlink;
import com.sun.webui.jsf.component.ImageHyperlink;
import com.sun.webui.jsf.component.PanelLayout;
import com.sun.webui.jsf.component.StaticText;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlDataTable;
import javax.faces.component.html.HtmlSelectManyListbox;

/**
 * <p>Fragment bean that corresponds to a similarly named JSP page
 * fragment.  This class contains component definitions (and initialization
 * code) for all components that you have defined on this fragment, as well as
 * lifecycle methods and event handlers where you may add behavior
 * to respond to incoming events.</p>
 *
 * @version EscritosPorGeneroCentro.java
 * @version Created on 16-dic-2008, 11:47:30
 * @author Administrador
 */

public class EscritosPorGeneroCentro extends AbstractFragmentBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">

    /**
     * <p>Automatically managed component initialization. <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
    }
    private Hyperlink hyperlinkFiccion = new Hyperlink();

    public Hyperlink getHyperlinkFiccion() {
        return hyperlinkFiccion;
    }

    public void setHyperlinkFiccion(Hyperlink h) {
        this.hyperlinkFiccion = h;
    }
    private PanelLayout layoutPanelFiccion = new PanelLayout();

    public PanelLayout getLayoutPanelFiccion() {
        return layoutPanelFiccion;
    }

    public void setLayoutPanelFiccion(PanelLayout pl) {
        this.layoutPanelFiccion = pl;
    }
    private Hyperlink hyperlinkNoFiccion = new Hyperlink();

    public Hyperlink getHyperlinkNoFiccion() {
        return hyperlinkNoFiccion;
    }

    public void setHyperlinkNoFiccion(Hyperlink h) {
        this.hyperlinkNoFiccion = h;
    }
    private PanelLayout layoutPanelNoFiccion = new PanelLayout();

    public PanelLayout getLayoutPanelNoFiccion() {
        return layoutPanelNoFiccion;
    }

    public void setLayoutPanelNoFiccion(PanelLayout pl) {
        this.layoutPanelNoFiccion = pl;
    }
    private PanelLayout layoutPanelPoesia = new PanelLayout();

    public PanelLayout getLayoutPanelPoesia() {
        return layoutPanelPoesia;
    }

    public void setLayoutPanelPoesia(PanelLayout pl) {
        this.layoutPanelPoesia = pl;
    }
    private Hyperlink hyperlinkInfantil1 = new Hyperlink();

    public Hyperlink getHyperlinkInfantil1() {
        return hyperlinkInfantil1;
    }

    public void setHyperlinkInfantil1(Hyperlink h) {
        this.hyperlinkInfantil1 = h;
    }
    private ImageHyperlink hyperlinkProsa = new ImageHyperlink();

    public ImageHyperlink getHyperlinkProsa() {
        return hyperlinkProsa;
    }

    public void setHyperlinkProsa(ImageHyperlink ih) {
        this.hyperlinkProsa = ih;
    }
    private ImageHyperlink hyperlinkPoesia = new ImageHyperlink();

    public ImageHyperlink getHyperlinkPoesia() {
        return hyperlinkPoesia;
    }

    public void setHyperlinkPoesia(ImageHyperlink ih) {
        this.hyperlinkPoesia = ih;
    }
    private StaticText staticText1 = new StaticText();

    public StaticText getStaticText1() {
        return staticText1;
    }

    public void setStaticText1(StaticText st) {
        this.staticText1 = st;
    }
    private PanelLayout layoutPanelListaEscritos = new PanelLayout();

    public PanelLayout getLayoutPanelListaEscritos() {
        return layoutPanelListaEscritos;
    }

    public void setLayoutPanelListaEscritos(PanelLayout pl) {
        this.layoutPanelListaEscritos = pl;
    }
   
    // </editor-fold>
    
    public EscritosPorGeneroCentro() {
    }

    /**
     * <p>Callback method that is called whenever a page containing
     * this page fragment is navigated to, either directly via a URL,
     * or indirectly via page navigation.  Override this method to acquire
     * resources that will be needed for event handlers and lifecycle methods.</p>
     * 
     * <p>The default implementation does nothing.</p>
     */
    @Override
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
        
        
        // <editor-fold defaultstate="collapsed" desc="Visual-Web-managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("Page1 Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        }
        
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
    }

    /**
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called.  Override this
     * method to release resources acquired in the <code>init()</code>
     * resources that will be needed for event handlers and lifecycle methods.</p>
     * 
     * <p>The default implementation does nothing.</p>
     */
    @Override
    public void destroy() {
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1) getBean("ApplicationBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1) getBean("SessionBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected RequestBean1 getRequestBean1() {
        return (RequestBean1) getBean("RequestBean1");
    }



    public String hyperlinkProsa_action() {
       this.getSessionBean1().setBoolean_prosa(1);
       
       hyperlinkFiccion.setVisible(true);
       hyperlinkNoFiccion.setVisible(true);

        if( this.getSessionBean1().getBoolean_poesia() == 1){
            layoutPanelPoesia.setVisible(false);
            this.getSessionBean1().setBoolean_poesia(0);
        }

        if( this.getSessionBean1().getBoolean_ficcion() == 1){
               layoutPanelFiccion.setVisible(false);
               this.getSessionBean1().setBoolean_ficcion(0);
            }

       if( this.getSessionBean1().getBoolean_noFiccion() == 1){
               layoutPanelNoFiccion.setVisible(false);
               this.getSessionBean1().setBoolean_noFiccion(0);
            }

        return null;
    }


     public String hyperlinkFiccion_action() {
        this.getSessionBean1().setBoolean_ficcion(1);

        layoutPanelFiccion.setVisible(true);
        
        if( this.getSessionBean1().getBoolean_noFiccion() == 1){
               layoutPanelNoFiccion.setVisible(false);
               this.getSessionBean1().setBoolean_noFiccion(0);
            }

        return null;
    }


     public String hyperlinkNoFiccion_action() {
        this.getSessionBean1().setBoolean_noFiccion(1);

        layoutPanelNoFiccion.setVisible(true);

        if( this.getSessionBean1().getBoolean_ficcion() == 1){
               layoutPanelFiccion.setVisible(false);
               this.getSessionBean1().setBoolean_ficcion(0);
            }

        return null;
    }


//    public String hyperlinkPoesía_action() {
//        this.getSessionBean1().setBoolean_poesia(1);
//
//        layoutPanelPoesia.setVisible(true);
//        if( this.getSessionBean1().getBoolean_prosa() == 1)
//        {
//            hyperlinkFiccion.setVisible(false);
//            hyperlinkNoFiccion.setVisible(false);
//            this.getSessionBean1().setBoolean_prosa(0);
//
//            if( this.getSessionBean1().getBoolean_ficcion() == 1){
//               layoutPanelFiccion.setVisible(false);
//               this.getSessionBean1().setBoolean_ficcion(0);
//            }
//            if( this.getSessionBean1().getBoolean_noFiccion() == 1){
//               layoutPanelNoFiccion.setVisible(false);
//               this.getSessionBean1().setBoolean_noFiccion(0);
//            }
//        }
//
//        return null;
//    }

    public void listaEscritos(){
         Hyperlink newHyperlink = new Hyperlink();

    }

    public String hyperlinkPoesia_action() {
        this.getSessionBean1().setBoolean_poesia(1);

        layoutPanelPoesia.setVisible(true);
        if( this.getSessionBean1().getBoolean_prosa() == 1)
        {
            hyperlinkFiccion.setVisible(false);
            hyperlinkNoFiccion.setVisible(false);
            this.getSessionBean1().setBoolean_prosa(0);

            if( this.getSessionBean1().getBoolean_ficcion() == 1){
               layoutPanelFiccion.setVisible(false);
               this.getSessionBean1().setBoolean_ficcion(0);
            }
            if( this.getSessionBean1().getBoolean_noFiccion() == 1){
               layoutPanelNoFiccion.setVisible(false);
               this.getSessionBean1().setBoolean_noFiccion(0);
            }
        }
        return null;
    }

    public String hyperlinkInfantil1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkErotismo1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkFantasia1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkGeneralFiccion1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkBiografia1_action() {
       hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkEditorial1_action() {
       hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkEnsayo1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkInfantil2_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkExperimental1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkErotismo2_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("olor: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }

    public String hyperlinkGeneralPoesia1_action() {
        hyperlinkProsa.setVisible(false);
        hyperlinkPoesia.setVisible(false);
        hyperlinkFiccion.setVisible(false);
        hyperlinkNoFiccion.setVisible(false);
        layoutPanelFiccion.setVisible(false);
        staticText1.setText("Lista de Escritos:");
        staticText1.setStyle("color: rgb(51, 51, 51); font-family: 'Arial','Helvetica',sans-serif; font-size: 16px; left: 10px; top: 72px; position: absolute");
        layoutPanelListaEscritos.setVisible(true);
        return null;
    }


 

}
